# 河流。调用父类初始化参数，并增加额外参数
class river:
	def __init__(
			self,
			id:str = None,
			name:str = None,
			time_beans: list = None,
			end: bool = False,
			root: bool = False,
			rivers: list = [],
			stations: list = [],
			intakes: list = [],
			elements: list = [],
			districts: list = []):
		self.time_beans = time_beans
		self.id = id  # id
		self.name = name  # 名称
		self.end = end #是否是最後一個
		self.root = root  # 干流标志位 True/False
		self.rivers = rivers  # 河道上所有支流 river实例列表
		self.stations = stations  # 河道上所有水库 station实例列表
		self.intakes = intakes  # 河道上所有取水口 intake实例列表
		self.elements = elements  # 河道上所有元素 所有东西的实例列表
		self.districts = districts  # 河道上所有分区 District实例列表

	def getEnd(self):
		return self.end

	def setEnd(self, end: bool = False):
		self.end = end

	def getTimeBeans(self):
		return self.time_beans

	def setTimeBeans(self, time_beans: list = None):
		self.time_beans = time_beans

	def getRoot(self):
		return self.root
	
	def setRoot(self, root: bool = False):
		self.root = root
	
	def getRivers(self):
		return self.rivers
	
	def setRivers(self, rivers: list = None):
		self.rivers = rivers
	
	def getStations(self):
		return self.stations
	
	def setStations(self, stations: list = None):
		self.stations = stations
	
	def getIntakes(self):
		return self.intakes
	
	def setIntakes(self, intakes: list = None):
		self.intakes = intakes
	
	def getElements(self):
		return self.elements
	
	def setElements(self, elements: list = None):
		self.elements = elements

	def getDistricts(self):
		return self.districts

	def setDistricts(self, districts: list = None):
		self.districts = districts
# # 创建River类实例
# river1 = River(id='u1001', name='定风波', t=1, distance_to_root=100.23, outflow_max=100, outflow_min=10, level_min=3,
#                    delta_t=2, river='烟波河', district='金陵', capacity=1000, time_beans=[1, 2, 3, 4], upper=['1', '2', '3'],
#                    down=['5', '6', '7'], upper_station=['01', '05'])
#
# river2 = River(id='u1002', name='江城子', t=1, distance_to_root=100.05, outflow_max=105, outflow_min=11, level_min=4,
#                    delta_t=5, river='玉带河', district='塞北', capacity=800, time_beans=[1, 2, 3, 4], upper=['1', '2', '3'],
#                    down=['5', '6', '7'], upper_station=['04', '06'])
# river3 = River(id='u1003', name='青玉案', t=2, outflow_max=101, outflow_min=13, level_min=4, river='玉带河', capacity=800,
#                root=True)
#
#
# dtr = River.get_distance_to_root(river1)
# print(dtr)
#
# root = river3.get_root()
# print(root)
#
# river2.set_intakes([1, 2, 3, 4])
# cap = river2.get_intakes()
# print(cap)
